//
// Created by Tan Ke on 2023/11/30.
//

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

char* longestCommonPrefix(char** strs, int strsSize)
{
    char* result = (char*)malloc(sizeof(char) * 201);
    memset(result, 0, 201);

    memcpy(result, strs[0], strlen(strs[0]));

    for (int i = 1; i < strsSize; i ++) {
        if (strlen(result) == 0) {
            break;
        }
        if (strlen(result) > strlen(strs[i])) {
            result[strlen(strs[i])] = 0;
        }
        for (int m = 0; m < strlen(result); m ++) {
            if (result[m] != strs[i][m]) {
                result[m] = 0;
                break;
            }
        }
    }

    return result;
}


int main(void)
{
    return 0;
}